﻿using System.Collections.Generic;

namespace Charades.Web.DAL.DBMSAdapters.MSSQL
{
	public sealed class MSSQLAdapter : IDBMSAdapter
	{
		private dpMainDBEntities _dbContext;

		/// <summary>
		/// Actual db context for any direct actions bypassing internal logic of an adapter
		/// </summary>
		public dpMainDBEntities DirectDbContext
		{
			get
			{
				return _dbContext ?? (_dbContext = new dpMainDBEntities());
			}
		}


		public void InitAdapter()  //Testing MSSQL access with simple query (current datetime in this case)
		{
			using (var db = DirectDbContext)
			{
				var test = db.Database.ExecuteSqlCommand("SELECT GETDATE();");
			}
		}

		public List<string> FetchAllWords()
		{
			throw new System.NotImplementedException();
		}

		public void Dispose()
		{

		}
	}
}